package br.com.lh.urabuilder.helper
{
	/**
	 * Controls which mouseEvent can occur in a given moment. 
	 * Basically, just one of ComponentMoving, ArrowDragging or RectangleSelection events can occur 
	 * at any given time.
	 * 
	 * 
	 * @author Luiz Henrique
	 * 
	 */
	public class MouseEventHelper
	{
		private var _isMouseDrawingRectangle:Boolean = false;
		private var _isMouseMovingComponent:Boolean = false;
		private var _isMouseMovingArrow:Boolean = false;
		
		public function set isMouseDrawingRectangle(value:Boolean):void{
			this._isMouseDrawingRectangle = value;
			if (value == true){
				this._isMouseMovingArrow = false;
				this._isMouseMovingComponent = false;
			}
		}
		
		public function get isMouseDrawingRectangle():Boolean{
			return _isMouseDrawingRectangle;
		}
		
		public function set isMouseMovingComponent(value:Boolean):void{
			this._isMouseMovingComponent = value;
			if (value == true){
				this._isMouseDrawingRectangle = false;
				this._isMouseMovingArrow = false;
			}
		}
		
		public function get isMouseMovingComponent():Boolean{
			return _isMouseMovingComponent;
		}
		
		public function set isMouseMovingArrow(value:Boolean):void{
			this._isMouseMovingArrow = value;
			if (value == true){
				this._isMouseMovingComponent = false;
				this._isMouseDrawingRectangle = false;
			}
		}
		
		public function get isMouseMovingArrow():Boolean{
			return _isMouseMovingArrow;
		}
		
		public function isRectangleAllowed():Boolean{
			return !_isMouseMovingComponent && !isMouseMovingArrow; 
		}
		
		public function isArrowDraggingAllowed():Boolean{
			return !_isMouseDrawingRectangle && !isMouseMovingComponent; 
		}
		
		public function isComponentMovingAllowed():Boolean{
			return !_isMouseMovingArrow && !isMouseDrawingRectangle; 
		}
		
		
		
		
		public function MouseEventHelper()
		{
		}

	}
}